import request from '@/utils/request'

// 获取树状机构信息
export const treeShapedApi = () => {
  return request({
    method: 'get',
    url: '/business-hall/tree'
  })
}

// 获取机构详情
export const InstitutionalDetails = (id, params) => {
  return request({
    method: 'get',
    url: `/business-hall/${id}`,
    params
  })
}

// 获取员工详情
export const empCourier = (id) => {
  return request({
    method: 'get',
    url: `/business-hall/user/${id}`

  })
}
// 获取快递员分页数据

export const employeeLnformation = (params) => {
  return request({
    method: 'get',
    url: '/business-hall/user/page',
    params
  })
}

// 省市区联动地址获取
export function getadressapi (params) {
  return request({
    method: 'get',
    url: '/areas/children',
    params
  })
}
// 获取省份
export const getProvinceApi = () => {
  return request({
    method: 'get',
    url: '/areas/children'

  })
}
// 获取城市
export const getCityApi = (id) => {
  return request({
    method: 'get',
    url: '/areas/children',
    params: {
      parentId: id
    }
  })
}

// 机构作业范围
export const getMapinfoApi = (id) => {
  return request({
    method: 'get',
    url: `/business-hall/scope/${id}/1`,
    params: {
      0: id
    }
  })
}

// 保存业务范围
export const getscope = (data) => {
  return request({
    method: 'post',
    url: '/business-hall/courier/scope',
    data
  })
}
// 获取业务范围
export const getscopeInfo = (id, type) => {
  return request({
    method: 'post',
    url: `/business-hall/courier/scope/${id}/${type}`,
    params: { 0: type }
  })
}
